package com.ruoyi.hr.controller.hr.empInfo;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.Ztree;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zeo
 * @explain 职员信息
 * @date 2020/3/2
 */
@Controller
@RequestMapping("/empInfo")
public class EmpInfoController extends BaseController {


    private String prefix = "hr/empinfo";

    /**
     * 跳转分页页面
     */
    @GetMapping()
    public String empInfo() {
        return prefix + "/empInfo";
    }

    /**
     * 欢迎
     */
    @GetMapping("/welcome")
    public String welcome() {
        return prefix + "/welcome";
    }

    /**
     * 加载薪资管理左侧树状
     */
    @GetMapping("/treeData")
    @ResponseBody
    public List<Ztree> treeData() {
        List<Ztree> ztrees = new ArrayList<Ztree>();
        Ztree ztree[] = {
                new Ztree((long) 100, (long) 0, "职员信息", "职员信息"),
                new Ztree((long) 101, (long) 100, "在职员工", "在职员工"),
                new Ztree((long) 102, (long) 100, "离职员工", "离职员工"),
                new Ztree((long) 103, (long) 100, "退休员工", "退休员工"),

                new Ztree((long) 104, (long) 0, "常用查询", "常用查询"),
                new Ztree((long) 105, (long) 104, "年龄统计", "年龄统计"),
                new Ztree((long) 106, (long) 104, "司龄统计", "司龄统计"),
                new Ztree((long) 107, (long) 104, "工龄统计", "工龄统计"),
                new Ztree((long) 108, (long) 104, "学历统计", "学历统计"),
                new Ztree((long) 109, (long) 104, "员工分类统计", "员工分类统计"),
                new Ztree((long) 110, (long) 104, "员工异动统计", "员工异动统计"),
                new Ztree((long) 111, (long) 104, "组合统计查询", "组合统计查询"),
                new Ztree((long) 112, (long) 104, "黑名单人员查询", "黑名单人员查询"),

                new Ztree((long) 113, (long) 0, "历史职员信息", "历史职员信息"),
                new Ztree((long) 114, (long) 113, "职员信息", "职员信息"),

                new Ztree((long) 115, (long) 0, "常用提醒", "常用提醒"),
                new Ztree((long) 116, (long) 115, "合同未签订", "合同未签订"),
                new Ztree((long) 117, (long) 115, "合同将到期", "合同将到期"),
                new Ztree((long) 118, (long) 115, "合同已到期", "合同已到期"),
                new Ztree((long) 119, (long) 115, "需签无固定期限合同", "需签无固定期限合同"),
                new Ztree((long) 120, (long) 115, "试用将到期", "试用将到期"),
                new Ztree((long) 121, (long) 115, "试用已过期", "试用已过期"),
                new Ztree((long) 122, (long) 115, "实习将到期", "实习将到期"),
                new Ztree((long) 123, (long) 115, "实习已过期", "实习已过期"),
                new Ztree((long) 124, (long) 115, "证件将到期", "证件将到期"),
                new Ztree((long) 125, (long) 115, "证件已过期", "证件已过期"),
                new Ztree((long) 126, (long) 115, "今日生日员工", "今日生日员工"),

        };
        for (int i = 0; i < ztree.length; i++) {
            ztrees.add(ztree[i]);
        }
        return ztrees;
    }
}
